import {
  showWxToast
} from '../../../../utils/index';

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    conditionOfUserSource5: {
      type: String,
      value: '0'
    }
  },
  attached() {},

  /**
   * 组件的初始数据
   */
  data: {
    isAgree: false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    continue () {
      if (!this.data.isAgree) {
        showWxToast('请阅读并同意《用户服务协议及隐私保护政策》');
        return;
      }
      this.triggerEvent('continueEvent');
    },
    back() {
      if (this.data.conditionOfUserSource5 === '1') {
        wx.switchTab({
          url: '/pages/index/index'
        });
      } else {
        wx.navigateBack({
          delta: 1,
        });
      }

    },
    handleCheckChange(e) {
      ;
      this.setData({
        isAgree: e.detail.value,
      });
    },
    toAgree() {
      wx.navigateTo({
        url: '/pages/identification/components/agreement/agreement'
      });
    },
  },
});